﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title></title>
<script type="text/javascript" src="../../_data/SysConfig.js"></script>
<script type="text/javascript" src="../../_data/json/_speciallist.js?time=New Date()"></script>
<script type="text/javascript" src="../../_libs/jquery-min.js"></script>
<script type="text/javascript" src="../../_libs/jquery.jtemplates.js"></script>
<script type="text/javascript" src="../../scripts/jumbotcms.js?v4"></script>
<script type="text/javascript" src="../../scripts/front.js?4"></script>
<link type="text/css" rel="stylesheet" href="../../style/global.css" />
<script type="text/javascript" src="../../admin/otherpage/styles/common.js"></script>
<link type="text/css" rel="stylesheet" href="../../admin/otherpage/styles/common.css" />
<script type="text/javascript" src="../../admin/otherpage/scripts/admin.js"></script>
<script type="text/javascript">
var pagesize=10;
var page=thispage();
$(document).ready(function(){
	ajaxList(page);
});
function ajaxList(currentpage)
{
	if(currentpage!=null) page=currentpage;
	top.JumbotCms.Loading.show("正在加载数据,请等待...");
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"page="+currentpage+"&pagesize="+pagesize+"&time="+(new Date().getTime()),
		url:		"ajax.aspx?oper=ajaxGetList",
		error:		function(XmlHttpRequest,textStatus, errorThrown){top.JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				top.JumbotCms.Loading.hide();
				$("#ajaxList").setTemplateElement("tplList", null, {filter_data: true});
				$("#ajaxList").processTemplate(d);
				$("#ajaxPageBar").html(d.pagerbar);
				break;
			}
		}
	});
}
function ConfirmDel(id){
	top.JumbotCms.Confirm("确定要删除专题并撤销所有的内容吗?", "IframeOper.ajaxDel("+id+")");
}
function ajaxDel(id){
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+id,
		url:		"ajax.aspx?oper=ajaxDel&time="+(new Date().getTime()),
		error:		function(XmlHttpRequest,textStatus, errorThrown){top.JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				ajaxList(page);
				break;
			}
		}
	});
}
function ajaxCreateSpecial(id){
	top.JumbotCms.Loading.show("正在生成...");
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+id,
		url:		"ajax.aspx?oper=ajaxCreateSpecial&time="+(new Date().getTime()),
		error:		function(XmlHttpRequest,textStatus, errorThrown){top.JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				top.JumbotCms.Alert(d.returnval, "1");
				break;
			}
		}
	});
}
function ajaxUpdateFore1()
{
	top.JumbotCms.Loading.show("正在更新，请等待...");
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"time="+(new Date().getTime()),
		url:		"ajax.aspx?oper=updatefore",
		error:		function(XmlHttpRequest,textStatus, errorThrown){JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				top.JumbotCms.Alert(d.returnval, "1");
				window.location.reload();
				break;
			}
		}
	});
}
function ajaxUpdateFore2()
{
	top.JumbotCms.Loading.show("正在更新，请等待...");
	ajaxPluginSpecialList("temporarydiv", "js");
	ajaxPluginSpecialList("temporarydiv", "html");
	top.JumbotCms.Alert("更新完成", "1");
}
</script>
</head>
<body>
<div id="temporarydiv" style="display:none;"></div>
<div class="topnav"> <span class="preload1"></span><span class="preload2"></span>
	<ul id="topnavbar">
		<li class="topmenu"><a href="javascript:void(0);" onclick="top.JumbotCms.Popup.show(site.Dir + 'admin/special/edit.aspx?id=0',500,280,true)" class="top_link"><span>添加专题</span></a> </li>
	</ul>
	<script>
	topnavbarStuHover();
        </script>
</div>
<table class="helptable">
	<tr>
		<td><ul>
				<li>①只创建有特殊意义的专题页，若是普通的关联内容，可通过定义相同的“标签”来实现。</li>
				<li>②每个专题对应独立的模板页，可在线编辑模板。</li>
			</ul>
		</td>
	</tr>
</table>
        <table cellspacing="0" cellpadding="0" width="100%" class="maintable">
            <tr>
                <th>
                    更新前台数据
                </th>
                <td align="left">
                    <input type="button" value="执行" class="btnsubmit" onclick="ajaxUpdateFore1();" />
                </td>
                <th>
                    更新前台页面
                </th>
                <td align="left">
                    <input type="button" value="执行" class="btnsubmit" onclick="ajaxUpdateFore2();" />
                </td>
            </tr>
        </table>
<textarea id="tplList" style="display:none">
	<table class="listtable" cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse;">
		<tr>
			<th scope="col" style="width:40px;">ID</th>
			<th scope="col" width="*">专题名称</th>
			<th scope="col" style="width:320px;">专题文件路径</th>
			<th scope="col" style="width:240px;">操作</th>
		</tr>
		{#foreach $T.table as record}
		<tr onMouseOver="this.style.backgroundColor='F3F7FF'" onMouseOut="this.style.backgroundColor='FFFFFF'">
			<td align="center">{$T.record.id}</td>
			<td align="left">{$T.record.title}</td>
			<td align="left"><a target="_blank" href="../../special/{$T.record.source}">{site.Dir}special/{$T.record.source}</a></td>
			<td align="center">
				<a href="javascript:void(0);" onclick="top.JumbotCms.Popup.show(site.Dir + 'admin/special/edit.aspx?id={$T.record.id}',500,280,true)">修改</a>
				<a href="javascript:void(0);" onclick="top.JumbotCms.Popup.show(site.Dir + 'admin/specialcontent/list.htm?sid={$T.record.id}',-1,-1,true)">内容管理</a>
				<a href="javascript:void(0);" onclick="top.JumbotCms.Popup.show(site.Dir + 'admin/special/edittemplate.aspx?id={$T.record.id}',560,420,true)">模板编辑</a>
				<a href="javascript:void(0);" onclick="ajaxCreateSpecial({$T.record.id})">静态生成</a>
				<a href="javascript:void(0);" onclick="ConfirmDel({$T.record.id})">删除</a>
			</td>
		</tr>
		{#/for}
	</table>
</textarea>
<div id="ajaxList"> </div>
<div id="ajaxPageBar" class="pages"> </div>
</body>
</html>
